﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WeixinSB.Model;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace WeixinSB.Common
{
    public class PraiseTemplateSelector : DataTemplateSelector
    {
        public DataTemplate FirstTemplate { get; set; }
        public DataTemplate SecondTemplate { get; set; }
        public DataTemplate ThirdTemplate { get; set; }  
        //public DataTemplate FourTemplate { get; set; }

        protected override DataTemplate SelectTemplateCore(object item, DependencyObject container)
        {
            var type = ((CommentModel)item).Type;

            if (type == "1")
            {
                return this.FirstTemplate;
            }
            else if (type == "2")
            {
                return this.SecondTemplate;
            }
            else if (type == "3")
            {
                return this.ThirdTemplate;
            }
            //else if (type == "4")
            //{
            //    return this.FourTemplate;
            //}
            return base.SelectTemplateCore(item, container);
        }
    }
}
